package com.xd.pre.modules.tpshop.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.xd.pre.common.utils.Result;
import com.xd.pre.modules.tpshop.domain.*;
import com.xd.pre.modules.tpshop.service.*;
import com.xd.pre.modules.tpshop.util.CommonFunction;
import com.xd.pre.modules.tpshop.virtuaBean.*;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.convert.EntityWriter;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lx
 * @since 2020-06-03
 */
@RestController
@RequestMapping("/order")
public class TpOrderController {

    @Autowired
    private ITpOrderService order_biz;
    @Autowired
    private ITpOrderActionService orderAction_biz;
    @Autowired
    private ITpOrderGoodsService og_biz;

    @Autowired
    private ITpUserAddressService address_biz;
    @Autowired
    private ITpShippingService ship_biz;
    @Autowired
    private ITpPaymentService pay_biz;


    //【1】 http://localhost:8080/tpshop_server/order/addOrder_part1?order_sn=201703271922459926&user_id=1&address_id=1&shipping_id=5&invoice_title=null&
//	 goods_price=0.02&shipping_price=0.00&user_money=0.00&coupon_price=0.00&integral=0&integral_money=0.00&
//	 order_amount=0.02&total_amount=0.00&add_time=1457140970&order_prom_id=0&order_prom_amount=0.00
    @RequestMapping(value="/addOrder_part1",method=RequestMethod.GET)

    public Result addOrder_part1(HttpServletRequest request){

        Result result = new Result();
        TpOrder oo = new TpOrder();
        oo.setOrderSn(request.getParameter("order_sn")); //注意： "order_sn"	UNIQUE KEY  不能重复
        oo.setUserId(Integer.parseInt(request.getParameter("user_id")));
        oo.setAddressId(Integer.parseInt(request.getParameter("address_id")));
        oo.setShippingId(Integer.parseInt(request.getParameter("shipping_id")));
        oo.setInvoiceTitle(request.getParameter("invoice_title"));

        oo.setGoodsPrice(new BigDecimal(request.getParameter("goods_price")));
        oo.setShippingPrice(new BigDecimal(request.getParameter("shipping_price")));
        oo.setUserMoney(new BigDecimal(request.getParameter("user_money")));
        oo.setCouponPrice(new BigDecimal(request.getParameter("coupon_price")));
        oo.setIntegral(Integer.parseInt(request.getParameter("integral")));
        oo.setIntegralMoney(new BigDecimal(request.getParameter("integral_money")));

        oo.setOrderAmount(new BigDecimal(request.getParameter("order_amount")));
        oo.setTotalAmount(new BigDecimal(request.getParameter("total_amount")));
        oo.setAddTime(Integer.parseInt(request.getParameter("add_time")));
        oo.setOrderPromId(Integer.parseInt(request.getParameter("order_prom_id")));
        oo.setOrderPromAmount(new BigDecimal(request.getParameter("order_prom_amount")+""));
        boolean save = order_biz.save(oo);
        int res = save ? 1 : -1;
//        int res = order_biz.addOrder_part1(
//                request.getParameter("order_sn"),	//注意： "order_sn"	UNIQUE KEY  不能重复
//                Integer.parseInt(request.getParameter("user_id")),
//                Integer.parseInt(request.getParameter("address_id")),
//                Integer.parseInt(request.getParameter("shipping_id")),
//                request.getParameter("invoice_title"),
//
//                Double.parseDouble(request.getParameter("goods_price")),
//                Double.parseDouble(request.getParameter("shipping_price")),
//                Double.parseDouble(request.getParameter("user_money")),
//                Double.parseDouble(request.getParameter("coupon_price")),
//                Integer.parseInt(request.getParameter("integral")),
//                Double.parseDouble(request.getParameter("integral_money")),
//
//                Double.parseDouble(request.getParameter("order_amount")),
//                Double.parseDouble(request.getParameter("total_amount")),
//                Integer.parseInt(request.getParameter("add_time")),								// 注意：时间戳 是int或者long类型！
//                Integer.parseInt(request.getParameter("order_prom_id")),
//                Double.parseDouble(request.getParameter("order_prom_amount")) );

        result.setData(res);

        return result;
    }

    //【2】 http://localhost:8080/tpshop_server/order/cancel_order?orderId=1&loginUserId=1
    @RequestMapping(value="/cancel_order2",method=RequestMethod.GET)

    public Result cancel_order(HttpServletRequest request){
        String orderId = request.getParameter("orderId");
        String loginUserId = request.getParameter("loginUserId");
        TpOrder order = order_biz.findOrder(Integer.parseInt(orderId), Integer.parseInt(loginUserId));
        if(CommonFunction.poCheckNotNull(order)){ //检查是否未支付订单 已支付联系客服处理退款 // return array('status'=>-1,'msg'=>'订单不存在','result'=>'');
            Result result = new Result(); result.setTipMsg("订单不存在");  result.setStatus(Result.FAILED); //-1
            return result;
        }

        //检查是否未支付的订单
        if(order.getPayStatus()> 0 || order.getOrderStatus() > 0){//if($order['pay_status'] > 0 || $order['order_status'] > 0)
            Result result = new Result(); result.setTipMsg("支付状态或订单状态不允许");  result.setStatus(Result.FAILED); //-1
            return result;	//return array('status'=>-1,'msg'=>'支付状态或订单状态不允许','result'=>'');
        }

//		//获取记录表信息
//      //$log = M('account_log')->where(array('order_id'=>$order_id))->find();

        //有余额支付的情况 : ★★★ 这个等到完善整体功能了 在研究！！！
//        if( order.getUserMoney() > 0 || order.getIntegral()> 0){ // if($order['user_money'] > 0 || $order['integral'] > 0)
//            accountLog($user_id,$order['user_money'],$order['integral'],"订单取消，退回{$order['user_money']}元,{$order['integral']}积分");
//        }


        int row = order_biz.update_orderStatusTo3_whenCancelOrder(Integer.parseInt(orderId), Integer.parseInt(loginUserId) );
        //同时在 `tp_order_action`表记录此次的操作！

        TpOrderAction oo = new TpOrderAction();
        oo.setOrderId(Integer.parseInt(orderId));
        oo.setActionUser(Integer.parseInt(loginUserId));
        oo.setOrderStatus(3);
        oo.setShippingStatus(order.getShippingStatus());
        oo.setPayStatus(order.getPayStatus());
        oo.setActionNote("您取消了订单");
        oo.setLogTime(CommonFunction.get_Timestamp_java_10_int());
        oo.setStatusDesc("用户取消订单");
        boolean save = orderAction_biz.save(oo);
//        orderAction_biz.aad_orderAction_full(Integer.parseInt(orderId), loginUserId, 3, order.getShippingStatus(), order.getPayStatus(),
//                "您取消了订单", CommonFunction.get_Timestamp_java_10_int(), "用户取消订单");
        if(save ){
            Result result = new Result(); result.setTipMsg("取消订单 操作成功");  result.setStatus(Result.SUCCESS); //-1
            return result;
        }else{ // row = 0
            Result result = new Result(); result.setTipMsg("取消订单 操作失败");  result.setStatus(Result.FAILED); //-1
            return result;
        }

    }

    //订单确认收货
    //【2】 http://localhost:8080/tpshop_server/order/cancel_order?orderId=1&loginUserId=1
    @RequestMapping(value="/cancel_order",method=RequestMethod.GET)

    public Result confirm_order(HttpServletRequest request){
        String orderId = request.getParameter("orderId");
        String loginUserId = request.getParameter("loginUserId");

        TpOrder order = order_biz.findOrder_byKeyId(Integer.parseInt(orderId) );//.findOrder(Integer.parseInt(orderId), Integer.parseInt(loginUserId));
        if(order.getOrderStatus() != 1 ){ //已确认的订单  则不能收货确认
            Result result = new Result(); result.setTipMsg("已确认的订单  则不能收货确认");  result.setStatus(Result.FAILED); //-1
            return result; //return array('status'=>-1,'msg'=>'该订单不能收货确认');
        }

        int row = -1;
        if(order.getPaymentId() == 2){ //如果`pay_id`==2："货到付款" 则要设置$data['pay_time'] = time()， 否则则不需要设置$data['pay_time'] = time()
            row = order_biz.update_confirmOrder_has_paytime(Integer.parseInt(orderId) );
        }else{
            row = order_biz.update_confirmOrder_no_paytime(Integer.parseInt(orderId) );
        }
        if(row <= 0){
            Result result = new Result(); result.setTipMsg("确认订单update操作失败");  result.setStatus(Result.FAILED_3); //-3
            return result; //return array('status'=>-3,'msg'=>'操作失败');
        }

//		order_give($order);// 调用送礼物方法, 给下单这个人赠送相应的礼物 												//  ★★★ 这个等到完善整体功能了 在研究！！！
//
//        M('rebate_log')->where("order_id = $id")->save(array('status'=>2,'confirm'=>time()));//分销设置	//  ★★★ 这个等到完善整体功能了 在研究！！！

        Result result = new Result(); result.setTipMsg("订单确认收货 操作成功");  result.setStatus(Result.SUCCESS); //
        return result; //return array('status'=>1,'msg'=>'操作成功');
    }




    // 获取订单详情
    //【3】 http://localhost:8080/tpshop_server/order/getOrderDetail?orderId=678   &loginUserId=1
    @RequestMapping(value="/getOrderDetail",method=RequestMethod.GET)

    public Result getOrderDetail(HttpServletRequest request){
        String orderId = request.getParameter("orderId");

        if(!CommonFunction.stringCheckNotNull(orderId)){
            System.out.println("获取的参数orderId=null，请检查原因！");
        }
        TpOrder order = order_biz.findOrder_byKeyId(Integer.parseInt(orderId) );

//		orderBtn(order);// 订单该显示的按钮

//		set_btn_order_status(order);  // 添加属性  包括按钮显示属性 和 订单状态显示属性

        //`tp_delivery_doc`
//		$invoice_no = M('DeliveryDoc')->where("order_id = $id")->getField('invoice_no',true);
//        $order_info['invoice_no'] = implode(' , ', $invoice_no); //'物流单号'
//        // 获取 最新的 一次发货时间
//        $order_info['shipping_time'] = M('DeliveryDoc')->where("order_id = $id")->order('id desc')->getField('create_time');

//		//获取订单商品
//        $data = $this->userLogic->get_order_goods($order_info['order_id']);
//        $order_info['goods_list'] = $data['result'];
//		// //$order_info['total_fee'] = $order_info['goods_price'] + $order_info['shipping_price'] - $order_info['integral_money'] -$order_info['coupon_price'] - $order_info['discount'];

        Result res = new Result();

        OrderVirtual2App orderVirtual = orderBtn(order);
        if(CommonFunction.poCheckNotNull(orderVirtual)){
            res.setStatus(Result.SUCCESS);res.setTipMsg("获取成功");res.setData( orderVirtual );
        }else{
            res.setStatus(Result.FAILED);res.setTipMsg("获取失败");res.setData( "" );
        }

        return res;
    }
    //给订单数组添加属性  包括按钮显示属性 和 订单状态显示属性
//	public void set_btn_order_status(TpOrder $order){
////		$order.setOrderStatusCode( orderStatusDesc($order) );	// 订单状态显示给用户看的  for app
////		$order.setOrderStatusDesc("ORDER_STATUS_DESC");			// for app
//		Map map = orderBtn($order);// 订单该显示的按钮
//	}
    public OrderVirtual2App orderBtn(TpOrder order){ // JSONObject
        /**
         订单用户端显示按钮
         去支付     AND pay_status=0 AND order_status=0 AND pay_code ! ="cod"
         取消按钮  AND pay_status=0 AND shipping_status=0 AND order_status=0
         确认收货  AND shipping_status=1 AND order_status=0
         评价      AND order_status=1
         查看物流  if(!empty(物流单号))
         */
//		Map map = new HashMap(); map.put("pay_btn", 0);map.put("cancel_btn", 0);map.put("receive_btn", 0);
//								 map.put("comment_btn", 0);map.put("shipping_btn", 0);map.put("return_btn", 0);
////									$order.setOrderStatusCode( orderStatusDesc($order) );	// 订单状态显示给用户看的  for app
////									$order.setOrderStatusDesc("ORDER_STATUS_DESC");			// for app
//								 map.put("order_status_code", orderStatusCode(order));map.put("order_status_desc", "ORDER_STATUS_DESC");
//		order.setOrderStatusCode(orderStatusCode(order));
//		order.setOrderStatusDesc("ORDER_STATUS_DESC");

        OrderVirtual2App ov = null;

        if(CommonFunction.poCheckNotNull(order)){
            // 货到付款
            if(order.getPaymentId() == 2){ //如果`pay_id`==2："货到付款" //$order['pay_code'] == 'cod'
                if((order.getOrderStatus() ==0 || order.getOrderStatus()==1) && order.getShippingStatus() ==0 ) 	// 待发货
                    order.setCancelBtn(1);// map.put("cancel_btn", 1); // 取消按钮 (联系客服)
                if(order.getOrderStatus()==1 && order.getShippingStatus() ==1 ) //待收货
                    order.setReceiveBtn(1);// map.put("receive_btn", 1);	// 确认收货
                order.setReturnBtn(1);// map.put("return_btn", 1);	// 退货按钮 (联系客服)
            }else{ // 非货到付款
                if(order.getOrderStatus()==0 && order.getPayStatus() ==0 ) // 待支付
                    order.setPayBtn(0);// map.put("pay_btn", 0);	// 去支付按钮
                order.setCancelBtn(0);// map.put("cancel_btn", 0);// 取消按钮
                if((order.getOrderStatus() ==0 || order.getOrderStatus()==1) && order.getPayStatus() ==1 && order.getShippingStatus() ==0  )
                    order.setReturnBtn(1);// map.put("return_btn", 1); // 退货按钮 (联系客服)
                if(order.getPayStatus()==1 && order.getOrderStatus()==1 && order.getShippingStatus()==1) //待收货
                    order.setReceiveBtn(1);// map.put("receive_btn", 1);	// 确认收货
                order.setReturnBtn(1);// map.put("return_btn", 1);	// 退货按钮 (联系客服)
            }

            if(order.getOrderStatus()==2)
                order.setCommentBtn(1);// map.put("comment_btn", 1);	// 评价按钮
            order.setReturnBtn(1);// map.put("return_btn", 1);	// 退货按钮 (联系客服)
            if(order.getShippingStatus()!=0)	order.setShippingBtn(1);// ;// map.put("shipping_btn", 1);	// 查看物流
            if(order.getShippingStatus()==2 && order.getOrderStatus() ==1 ) 	// 部分发货
                order.setReturnBtn(1);// map.put("return_btn", 1);	// 退货按钮 (联系客服)

//			address_biz;ship_biz pay_biz

            ov = order_biz.get_OrderVirtual2App(order);

        }

        return ov;
    }
    //获取订单状态的 中文描述名称
    public String  orderStatusCode(TpOrder order) {
//			TpOrder order = order_biz.findOrder_byKeyId(orderId );
        // 货到付款
        if(order.getPaymentId() == 2){ //如果`pay_id`==2："货到付款" 则...
            if((order.getOrderStatus()==0 || order.getOrderStatus()==1)//(已支付 || 货到付款) && 未发货 && 已下单
                    && order.getShippingStatus()==0 )							return "waitSend"; 		//"待发货",	 //
        }else{ // 非货到付款
            //					        未支付 && 未下单
            if(order.getPayStatus()==0 && order.getOrderStatus()==0 )			return "waitPay"; 		//"待支付",	 //waitPay
            if((order.getOrderStatus()==0 || order.getOrderStatus()==1)
                    && order.getPayStatus()==1 && order.getShippingStatus() != 1 ) 	return "waitSend"; 		//"待发货",	 //waitSend		待发货: (已支付 || 货到付款) && 未发货 && 已下单
        }
        if(order.getShippingStatus()==1 && order.getOrderStatus()==1 )			return "waitReceive"; 	//"待收货",	 //waitReceive  待收货: 已发货 && 已下单

        if(order.getOrderStatus()==2 )											return "waitComment"; 	//"待评价",	 	//
        if(order.getOrderStatus()==3 )											return "CANCEL";  		//"已取消",	 	//
        if(order.getOrderStatus()==4 )											return "commented"; 	//"已完成(已评价)",	 //commented FINISH
        if(order.getOrderStatus()==5 )											return "returned"; 		//"已作废(已退货?)",// returned  CANCELLED

        return "OTHER";
    }

//    @Override //已移动至 ITpOrderService
//    public OrderVirtual2App get_OrderVirtual2App(TpOrder order){ //通用方法
//        List<TpOrderGoods> og_list = og_biz.findByOrderId( order.getOrderId() );
//        TpUserAddress adress = address_biz.findUserAddress_byKeyId(order.getAddressId());
//        TpShipping ship = ship_biz.find_byKeyId(order.getShippingId());
//        TpPayment pay = pay_biz.find_byKeyId(order.getPaymentId()); // 提交订单的时候  它为null ！
//        if(!CommonFunction.poCheckNotNull(pay)){ //if 是提交订单的时候 即不是 查阅历史订单的时候！
//            System.out.println("channel——1-您当前是在提交订单！或者app没有实现支付功能");
//            return new OrderVirtual2App(
//                    order.getOrderId(),
//                    order.getOrderSn(),
//                    order.getUserId(),
//
//                    order.getOrderStatus(),
//                    order.getShippingStatus(),
//                    order.getPayStatus(),
//
//                    //				order.getAddressId(),
//                    //				order.getShippingId(),
//                    //				order.getPaymentId(),
//                    adress.getConsignee(),
//                    adress.getProvince(),
//                    adress.getCity(),
//                    adress.getDistrict(),
//                    adress.getTwon(),
//                    adress.getAddress(),
//                    adress.getMobile(),
//                    adress.getEmail(),
//                    0,			//pay.getIsCod(),
//                    "",			//pay.getPayCode(),
//                    "",			//pay.getPayName(),
//                    ship.getShippingCode(),
//                    ship.getShippingName(),
//
//                    order.getInvoiceTitle(),
//
//                    order.getGoodsPrice(),
//                    order.getShippingPrice(),
//                    order.getUserMoney(),
//                    order.getCouponPrice(),
//                    order.getIntegral(),
//                    order.getIntegralMoney(),
//                    order.getOrderAmount(),
//                    order.getTotalAmount(),
//                    order.getAddTime(),
//
//                    order.getShippingTime(),
//                    order.getConfirmTime(),
//                    order.getPayTime(),
//
//                    order.getOrderPromId(),
//                    order.getOrderPromAmount(),
//
//                    order.getDiscount(),
//                    order.getUserNote(),
//                    order.getAdminNote(),
//                    order.getParentSn(),
//                    order.getIsDistribut(),
//
//                    order.getPayBtn(),
//                    order.getCancelBtn(),
//                    order.getReceiveBtn(),
//                    order.getCommentBtn(),
//                    order.getShippingBtn(),
//                    order.getReturnBtn(),
//                    order.getOrderStatusCode(),
//                    order.getOrderStatusDesc(),
//
//                    og_list
//            );
//        }else{
//            System.out.println("channel——2-您当前是在 查阅历史订单订单！");
//            return new OrderVirtual2App(	// 查阅历史订单的时候！即： 不是 提交订单的时候
//                    order.getOrderId(),
//                    order.getOrderSn(),
//                    order.getUserId(),
//
//                    order.getOrderStatus(),
//                    order.getShippingStatus(),
//                    order.getPayStatus(),
//
//                    //				order.getAddressId(),
//                    //				order.getShippingId(),
//                    //				order.getPaymentId(),
//                    adress.getConsignee(),
//                    adress.getProvince(),
//                    adress.getCity(),
//                    adress.getDistrict(),
//                    adress.getTwon(),
//                    adress.getAddress(),
//                    adress.getMobile(),
//                    adress.getEmail(),
//                    pay.getIsCod(),
//                    pay.getPayCode(),
//                    pay.getPayName(),
//                    ship.getShippingCode(),
//                    ship.getShippingName(),
//
//                    order.getInvoiceTitle(),
//
//                    order.getGoodsPrice(),
//                    order.getShippingPrice(),
//                    order.getUserMoney(),
//                    order.getCouponPrice(),
//                    order.getIntegral(),
//                    order.getIntegralMoney(),
//                    order.getOrderAmount(),
//                    order.getTotalAmount(),
//                    order.getAddTime(),
//
//                    order.getShippingTime(),
//                    order.getConfirmTime(),
//                    order.getPayTime(),
//
//                    order.getOrderPromId(),
//                    order.getOrderPromAmount(),
//
//                    order.getDiscount(),
//                    order.getUserNote(),
//                    order.getAdminNote(),
//                    order.getParentSn(),
//                    order.getIsDistribut(),
//
//                    order.getPayBtn(),
//                    order.getCancelBtn(),
//                    order.getReceiveBtn(),
//                    order.getCommentBtn(),
//                    order.getShippingBtn(),
//                    order.getReturnBtn(),
//                    order.getOrderStatusCode(),
//                    order.getOrderStatusDesc(),
//
//                    og_list
//            );
//        }
//
//
//    }

    // 用户订单列表  分页
    //【4】 http://localhost:8080/tpshop_server/order/getOrderList_byPage?loginUserId=1&type=all&pageIndex=1&pageSize=3
    @RequestMapping(value="/getOrderList_byPage",method=RequestMethod.GET)

    public Result getOrderList_byPage(HttpServletRequest request){
        String loginUserId = request.getParameter("loginUserId");
        String type = request.getParameter("type"); //orderStatus: waitPay,waitSend,waitReceive,waitComment,commented,returned,all
        String pageIndex = request.getParameter("pageIndex");
        String pageSize = request.getParameter("pageSize");
//		//条件搜索
//        //I('field') && $map[I('field')] = I('value');
//        //I('type') && $map['type'] = I('type');
//        //$map['user_id'] = $user_id;

        System.out.println("测试-type-： "+type);
        System.out.println("测试-pageIndex-： "+pageIndex);
        System.out.println("测试-pageSize-： "+pageSize);

        Result res = new Result();
        TpOrder dto = new TpOrder();

        IPage<TpOrder> orderIPage = order_biz.findList_byCondition(type, Integer.parseInt(pageIndex), Integer.parseInt(pageSize), dto);
        res.setStatus(Result.SUCCESS);
        res.setTipMsg("获取成功");
        res.setData(orderIPage);

//
//
////		List<TpOrder> o_list = order_biz.findList_byCondition(type, Integer.parseInt(pageIndex), Integer.parseInt(pageSize));
//        Map<String, List> map = order_biz.findList_byCondition(type, Integer.parseInt(pageIndex), Integer.parseInt(pageSize));
//
//
//        if(map != null){ // CommonFunction.listCheckNull(o_list)
//            @SuppressWarnings("unchecked")
//            List<TpOrder> o_list = (List<TpOrder>)map.get("order_list_byPage_byCondition");
//            @SuppressWarnings({ "unchecked", "rawtypes" })
//            List list2 = map.get("order_list_total_byCondition");
//            System.out.println("测试-98-："+ o_list.size());
//            System.out.println("测试-99-："+ list2.size());
//            int count = -1;
//            if(CommonFunction.listCheckNotNull(list2)){
//                count = Integer.parseInt(list2.get(0).toString()); //   COUNT(*)计算出来的结果数据BigInteger类型，不能直接强转为Integer类型！
//            }
//            System.out.println("测试-100-："+ o_list.size());
//            System.out.println("测试-101-："+ count);
//
//            List<OrderVirtual> ov_list = new ArrayList<OrderVirtual>();
//            List<OrderVirtual2App> ov_fro_app_list = new ArrayList<OrderVirtual2App>(); //diy
//            for (int i = 0; i < o_list.size(); i++) {
//                TpOrder oo =o_list.get(i);
//
//                OrderVirtual2App ov_fro_app = get_OrderVirtual2App( oo );
//                ov_fro_app_list.add(ov_fro_app);
//
////				List<TpOrderGoods> og_list = og_biz.findByOrderId( oo.getOrderId() );
////				System.out.println("测试—1—："+og_list.size());
////				OrderVirtual ov = new OrderVirtual(
////										oo.getOrderId(),
////										oo.getOrderSn(),
////										oo.getUserId(),
////
////										oo.getOrderStatus(),
////										oo.getShippingStatus(),
////										oo.getPayStatus(),
////
////										oo.getAddressId(),
////										oo.getShippingId(),
////										oo.getPaymentId(),
////
////										oo.getInvoiceTitle(),
////
////										oo.getGoodsPrice(),
////										oo.getShippingPrice(),
////										oo.getUserMoney(),
////										oo.getCouponPrice(),
////										oo.getIntegral(),
////										oo.getIntegralMoney(),
////										oo.getOrderAmount(),
////										oo.getTotalAmount(),
////										oo.getAddTime(),
////
////										oo.getShippingTime(),
////										oo.getConfirmTime(),
////										oo.getPayTime(),
////
////										oo.getOrderPromId(),
////										oo.getOrderPromAmount(),
////
////										oo.getDiscount(),
////										oo.getUserNote(),
////										oo.getAdminNote(),
////										oo.getParentSn(),
////										oo.getIsDistribut(),
////
////										oo.getPayBtn(),
////										oo.getCancelBtn(),
////										oo.getReceiveBtn(),
////										oo.getCommentBtn(),
////										oo.getShippingBtn(),
////										oo.getReturnBtn(),
////										oo.getOrderStatusCode(),
////										oo.getOrderStatusDesc(),
////
////										og_list
////									);
////				ov_list.add(ov);
//            }
//
//            res.setStatus(Result.SUCCESS);res.setTipMsg("获取成功");res.setData( ov_fro_app_list ); //ov_list
//        }else{
//            res.setStatus(Result.FAILED);res.setTipMsg("data失败(map=null),没有获取到任何data，或者说data已经加载完毕没有更多data了！");
//        }

        return res;




    }








}

